Styles

HoTMetaL provides screen-formatting capabilities that help you edit documents by allowing you to assign distinctive styles to the elements in your document. The purpose of these formatting features is only to improve the appearance of the document during the editing process. The styles that you set with HoTMetaL do not affect how browsers format the document. Only the markup affects how a document looks in a browser.

All screen-formatting is set using the Styles... command in the View menu.

Because HTML files are structured documents, setting a style for an element means setting it for all elements of that type.

The following styles can be set:

In addition, every element has a format type: block or inline. Block elements start and end on a separate line from adjacent content. Inline elements are not set off from adjacent text. All of the styles listed above can be applied to block elements; only font properties and color can be applied to inline elements.

You can change the format assigned to an element in the document at any time. When you choose the Styles... command, HoTMetaL gives you a dialog box allowing you to set formatting parameters for the current element (the one the insertion point or selection is in). If the insertion point is outside the HTML element that surrounds the entire document, the dialog box lets you set the default format. If you move the insertion point to a different element while the Styles dialog box is on the screen, the dialog box changes to reflect the formatting of the new element.

The Styles dialog box will look like the following illustration:
STYLES
The element name (P in this example) is displayed in the dialog's title bar.

Numerical values

The Styles dialog box allows you to enter numerical values for font size, line height, space above and below, and indention. These may be set from a menu or entered directly in a text entry box. As appropriate, these values may be absolute, relative (+/-), or expressed as a percentage of a base value. The following units may be used:

You can use any unit wherever you are allowed to enter values. For example, font size may be expressed in points, inches, picas, etc.

Units may be specified by giving the full unit name, or the first few letters of the unit name, as long as that is unambiguous (e.g., don't use `p' since that could mean `points' or `picas'). In addition, `cm' and `mm' specify centimeters and millimeters, respectively.

Examples

The following are examples of valid settings:

Notice that you don't have to have any space between the number and the unit.

Relative and percentage settings

Relative settings specify an amount to be added to or subtracted from a base setting: they have the same format as absolute settings, but start with a `+' or `-' sign. As well, you may set a value to be Adopt Current, which means that the value is to be inherited from the surrounding element. Some valid settings are:

Percentage values are specified with a percent ( %) sign, the word `percent', or a suitable abbreviation, e.g.:

Font properties

The font for the current element type is chosen from the label on the option button labeled Name. If you want the current element to inherit the font of the element that surrounds it, choose Adopt Current.

Style variations (bold, italic, etc.) can be specified using the Style list.

Font size

To select the font size, click on the Size option menu and choose any size (including Adopt Current) shown. You can also enter a size in the text entry box to the right of the menu. This size can be an absolute or relative value. If the size you chose is unavailable, HoTMetaL will choose the next smallest font size. Relative values (+2 points, -3 points, etc.) are added to the font size of the surrounding element.

Font style

The choices in the Style list allow you to add style variations to the font. These can be set individually or in any combination.

Adopt Current means that the font style options of the containing element are adopted in addition to those explicitly set for this element type. If Adopt Current is the only option selected, then the font style for an element of this type will be identical to the font style of its containing element.

If you select the Toggle font style, the other style settings are turned off in the current element if they are turned on in the containing element. For example, an element whose font style is set to Bold and Toggle will appear as bold text within plain (Roman) surrounding text and as plain within bold surrounding text.

Remember that HoTMetaL and Web browsers may not support the same font styles.

Paragraph styles

These styles determine how lines are formatted and are available only for block elements.

Alignment

HoTMetaL offers four styles of text alignment (also called justification)-left, right, centered, and `both' (that is, both left and right alignment). If you choose Adopt Current, the alignment style is inherited from the surrounding element. Choose the style you want from the option menu labeled Alignment in the Styles dialog box.

Fill

This group of choices allows you to specify how HoTMetaL should treat `return' characters for the current element type. If you type Return or Enter in an element formatted in No Fill mode, the element will be split. When Fill is selected, the element will not be split when you type Return or Enter.

Browsers typically display elements (with the exception of PRE) in fill mode.

The Show Invisibles command in the View menu will show you the location of `new line' characters.

Line height

You can select single, double, or triple spacing from the option menu labeled Line Height. A value may also be entered directly in the text entry box.

A percentage line height is interpreted as a percentage of single spacing. For example, 100 percent is the same as single spacing, 150 percent is 1.5 times as high as single spacing, and so on.

If you give a relative (+/-) value the line height will be equal to the single-spaced line height, plus or minus the amount specified.

An absolute line height should be at least as large as the point size: otherwise, the lines will overlap. A value of about 1.2 times the point size would be normal.

If you select Adopt Current for the line height, then the element you are formatting will assume the absolute line height of its surrounding element. This could give undesirable results if the line height of the surrounding element is smaller than the font size of the current element.

Space above and below

Space above and below control the vertical separation between elements. They are available only for block elements.

Space Above determines the minimum amount of vertical white space that must precede the current element. If the element before this one has a Space Below value, the actual separation will be the greater of the space above the current element and the space below the preceding element.

Space Below determines the minimum amount of vertical white space that must follow the element. The actual separation is the greater of the current element's bottom space and the next element's top space.

A space above or below can be specified as a percentage of one line height for the current element. For example, if you want 1 1/2 lines of white space between paragraphs, set the space above to 150%.

If you specify an absolute amount, it will be added to the normal line spacing.

Indention

The left indent is measured from the left margin of the document window; the right indent is measured from the right margin of the document window. The two indents effectively specify the line length for the element.

If you specify a relative (+/-) left or right indent it is added to or subtracted from the corresponding indent of the element that contains the current element. For example, a value of `+1 inches' for the left indent causes the indent to be one inch to the right of the left indent for the containing element. An indent of Adopt Current is equal to the corresponding indent of the containing element.

The first indent (indent for the first line) can be different from the indent for subsequent lines: this is often done for paragraphs. An absolute first indent will be measured from the left margin. A relative first indent will be added to or subtracted from the left indent for the current element. A first indent of Adopt Current is identical to the left indent.

Color

For each element type, you can choose a foreground color and a background color. The foreground color is the color of the text.

To choose the colors for an element, click on the [Colors...] button in the Styles dialog box.

HoTMetaL displays a dialog box containing two scrollable lists from which colors can be chosen, one for the background, one for the foreground.

COLORS

These lists contain the colors that are currently loaded into HoTMetaL. In addition, the lists contain entries Adopt Current, Default Background, and Default Foreground. To choose a color, click on the color in the list or type it in the text box directly. Then click on the [Apply] button.

If you choose Adopt Current, the color of the surrounding element will be adopted for the current element. Note that if you choose Adopt Current for either the foreground or background color, then the other one will revert to Adopt Current also. You can, however, use Default Background or Default Foreground in conjunction with another color choice.

Available colors

All of the available colors have an entry in one of the color map files:

These files associate each color name with three numbers that specify the mixture of primary colors that makes up the color. The entries in the color map files are in the form:

213 144 5 shoreslop

The three values range between 0 and 255 and indicate the red, green, and blue values, respectively. The numbers depend on the video card for your display. The sample entry above will cause the name `shoreslop' to appear in the foreground and background lists in the Colors dialog box.

To make more colors available to HoTMetaL, edit the color map file with a text editor and add entries like the one in the example above.

You can also add a color by typing its hexadecimal representation in one of the text boxes. This consists of six hexadecimal digits preceded by a number (hash) sign, `#'. For example: #ef6a02The first two digits indicate the red values, the next two the green values, and the last two the blue values. Again, the numbers depend on the video card for your display. This number will be added to the color lists.

The colors in the Colors dialog come from the local color map file only, but you can use a color from the system file by typing its name into the dialog box. By default, if the system and local color map files have an entry for the same color name but with different numbers, the entry in the local file takes precedence. You can reverse this behavior via the HoTMetaL configuration file. The following setting will make HoTMetaL give precedence to the system file:

use_local_color_defs=NO

After you make this setting you will have to restart HoTMetaL.

Highlight mode

Normally highlighted text is displayed in white, with the background in black. If you want highlighted text to be displayed in reverse-video (that is, the current text color becomes the background color, and vice versa) you can put the following setting in the HoTMetaL configuration file:

highlight_mode=invert

Once you've done this, restart HoTMetaL for it to take effect.

Limitations on the number of colors

X applications allocate a certain number of colors for their own use. Each display has a maximum number of colors that can be allocated (often this is 256) so you may find yourself running out of colors. To better manage your color resources, you can configure HoTMetaL to allocate a certain number of colors on start-up. To do this, enter a setting such as the following in the HoTMetaL configuration file:

colormap_segment_size=32

This doesn't limit the number of colors HoTMetaL can use, just the initial allocation. This setting will take effect the next time you launch HoTMetaL.

Invisible characters

Choose Show Invisibles in the View to see characters that would otherwise be invisible. A carriage return is represented by a `paragraph' symbol, a newline by a `sunburst' or `currency' symbol, a space by a raised dot, a tab by a hash (number) sign, `#', and a zero-width character by a tilde, `~'.

Choose Hide Invisibles to turn off the display of invisible characters.

Styles files

HoTMetaL stores the formatting information set with the Styles... command in a binary styles file called hm2.stl in the styles directory. Whenever the a document is saved, this styles file is updated with whatever styles are in effect for the document.